home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-03
/
qbasicpg.zip
/
ARGUMENT.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-08-31
|
826b
|
32 lines
' ARGUMENT.BAS
' This program demonstrates passing arguments to a subprogram.
DECLARE SUB AddInterest (monthName$, amount!)
month$ = "January" ' initialize month$ with value
' of "January"
balance! = 1500 ' initialize balance! with value of 1500
CLS
PRINT "Before subprogram:" ' display original values
PRINT " month$ = "; month$
PRINT " balance! ="; balance!
PRINT
AddInterest month$, balance! ' call subprogram to modify values
PRINT "After subprogram:" ' display modified values
PRINT " month$ = "; month$
PRINT " balance! ="; balance!
END
SUB AddInterest (monthName$, amount!)
monthName$ = "February" ' change name of month
amount! = amount! * 1.05 ' add 5% to amount
END SUB